<{extends file="<{$tempdir}>/public/admin.html"}> 
<{block name=extendjs}>
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/jquery.PrintArea.js" type="text/javascript" language="javascript"></script>
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/datepicker/WdatePicker.js" type="text/javascript" language="javascript"></script>
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/artdialog/plugins/iframeTools.js" type="text/javascript" language="javascript"></script>
<{/block}>
 <{block name=controlname}>所有订单<{/block}>
 <{block name=bodylist}>
     <div style="width:100%;margin-top:-10px;"> 
      	
      	<div class="search">
      		 
            
            <div class="search_content">
            	 
            	 <form method="post" name="form1" action="<{ofunc type=url link="/adminpage/station/module/stationorderlist"}>">
 				    <select name="cityid">
					<option value="0">所在城市</option> 
                      	 <{load_data assign="arealist" table="area"    fileds="*"  where=" parent_id=0 " orderby=" orderid asc " limit="1000" }>  
							<{foreach from=$arealist['list'] key=myid  item=items}>  
							   <option value="<{$items['adcode']}>" <{if $cityid == $items['adcode']}>selected<{/if}>><{$items['name']}></option>
							<{/foreach}> 
                      </select>
				 
            	  <label>查询类型：</label>
            	  <select name="querytype">
            	  	<option value="0">未选择</option>
            	  	<option value="mb.username"  <{if $querytype == 'mb.username'}>selected<{/if}>>会员名</option>
            	  	<option value="ord.shopname"  <{if $querytype == 'ord.shopname'}>selected<{/if}>>店铺名称</option> 
            	  	<option value="ord.buyername"  <{if $querytype == 'ord.buyername'}>selected<{/if}>>买家联系人</option>
            	  	<option value="ord.buyerphone"  <{if $querytype == 'ord.buyerphone'}>selected<{/if}>>买家联系电话</option>
            	  	<option value="ord.dno"  <{if $querytype == 'ord.dno'}>selected<{/if}>>订单编号</option>
            	  </select>
            	  <label>查询条件：</label>
            	   <input type="text" name="searchvalue" value="<{$searchvalue}>">
            	   
            	   <select name="orderstatus">
            	   	  <option value="all">选择订单状态</option> 
			   		 	  	  <option value="1" <{if $orderstatus == '1'}>selected<{/if}>>未处理</option>
			   		 	  	  <option value="2" <{if $orderstatus == '2'}>selected<{/if}>>已审核订单</option>
			   		 	      <option value="3" <{if $orderstatus == '3'}>selected<{/if}>>已发货</option>
			   		 	  	  <option value="4" <{if $orderstatus == '4'}>selected<{/if}>>已完成</option>
			   		 	  	  <option value="5" <{if $orderstatus == '5'}>selected<{/if}>>已关闭</option>
            	  </select>
            	  
            	   从<input class="Wdate datefmt" type="text" name="starttime" id="starttime" value="<{$starttime|date_format:"%Y-%m-%d"}>"  onFocus="WdatePicker({isShowClear:false,readOnly:true});" />  
			   		 	  到<input class="Wdate datefmt" type="text" name="endtime" id="endtime" value="<{$endtime|date_format:"%Y-%m-%d"}>"  onFocus="WdatePicker({isShowClear:false,readOnly:true});" />                  

            	  
            	    <input type="submit" value="提交查询" class="button">  
            	 
            	 </form>
            </div>
        
      	</div>
      	
      	
      	
           <div class="tags">

      	 	 

          <div id="tagscontent">

            <div id="con_one_1">

              <div class="table_td">

              <form method="post" action="" onsubmit="return remind();">
                <{if empty($list)}>
					<div style="font-size:16px; margin:20px 0px 0px 20px;">暂无数据</div>
                <{/if}>
                  <{foreach from=$list key=myid item=items}>  
			   		 
 <{if !empty($items['shopid']) && $items['shoptype'] != '100'   }>
					 
					 
			   		 <table class="table table-bordered" width=95% style="font-size:12px;margin-top:5px;text-align:left;margin-left:20px;" id="order_area_<{$items['id']}>" onMouseover="colorred(this);" onMouseout="tcolorred(this);">
	<{if $items['is_goshop'] == 1}>
		             <tr>
		             	<td colspan="2" style="text-align:left;">单号：<{$items['dno']}><font color=red>预订<{if $items['allcost'] == 0}>座位<{else}>座位和菜品<{/if}></font></td>
		             	<td colspan="2" style="text-align:left;">创建时间：<{$items['addtime']|date_format:"%Y-%m-%d %H:%M:%S"}></td>
		             	<td colspan="2" style="text-align:left;">订单状态: <font color=blue>
			
			<{if $items['is_make'] < 2 }>
				<{if $items['status'] == 1 }>
					等待用户到店消费
				<{elseif $items['status'] == 0  }>
					等待处理	
				<{elseif $items['status'] == 2 || $items['status'] ==3 }>
					已完成，用户已消费
				<{elseif $items['status'] == 4  }>
					商家已取消订单
				<{elseif $items['status'] ==5 }>
					管理员已取消订单
				<{/if}>
			<{else}>
				
				卖家已取消订单

			<{/if}>
						</font></td>
		            </tr>
		             <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">店铺名称：<{$items['shopname']}></td>
		             	<td colspan="2" style="text-align:left;">店铺地址：<{$items['shopaddress']}></td>
		             	<td colspan="2" style="text-align:left;">店铺电话: <{$items['shopphone']}></td> 
		            </tr>
		            <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">消费时间：<{$items['posttime']|date_format:"%Y-%m-%d"}> <{$items['postdate']}></td>
		             	<td colspan="2" style="text-align:left;">支付状态：<font color=red><{$paytypearr[$items['paytype']]|default:'未定义'}></font><{$payway[$items['paytype_name']]}>，<{if $items['paystatus'] == 1}>已付<{else}>未付<{/if}><font color=red><{$backarray[$items['is_reback']]}></font></td>
		             	<td colspan="2" style="text-align:left;">下单来源: <{$ordertypearr[$items['ordertype']]}><{$items['ipaddress']}></td>
		            </tr>
		            <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">订单类型：预订</td>   
		             	<td colspan="2" style="text-align:left;">ip信息：<{$items['ipaddress']}></td> 
		            </tr>
                <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">联系人：<{$items['buyername']}>[<{if empty($items['acountname'])}>游客<{else}>帐号:<{$items['acountname']}><{/if}>]</td>  
		             	<td colspan="2" style="text-align:left;">联系电话：<{$items['buyerphone']}></td> 
		             	<td colspan="2" style="text-align:left;"> <{assign var=showother value=$items['othertext']|unserialize}>   
		            		 		  	 <{foreach from=$showother key=mytest item=itc}>
		            		 		  	<font color=red> <{$mytest}></blue>:<{$itc}> </font>
		            		 		  	 <{/foreach}></td>  
		            </tr>
	 <{else}>
		             <tr>
		             	<td colspan="2" style="text-align:left;">单号：<{$items['dno']}><font color=red><{$shoptype[$items['shoptype']]}></font></td>
		             	<td colspan="2" style="text-align:left;">创建时间：<{$items['addtime']|date_format:"%Y-%m-%d %H:%M:%S"}></td>
		             	<td colspan="2" style="text-align:left;">订单状态: <font color=blue><{$buyerstatus[$items['status']]}></font></td>
		            </tr>
		             <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">店铺名称：<{$items['shopname']}></td>
		             	<td colspan="2" style="text-align:left;">店铺地址：<{$items['shopaddress']}></td>
		             	<td colspan="2" style="text-align:left;">店铺电话: <{$items['shopphone']}></td> 
		            </tr>
		            <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">支付方式：<font color=red><{$paytypearr[$items['paytype']]|default:'未定义'}><{if !empty($items['paytype_name'])}>(<{$payway[$items['paytype_name']]}>)<{/if}></font></td>
		             	<td colspan="2" style="text-align:left;">支付状态：<{if $items['paystatus'] == 1}>已付<{else}>未付<{/if}><font color=red><{$backarray[$items['is_reback']]}></font></td>
		             	<td colspan="2" style="text-align:left;">下单来源: <{$ordertypearr[$items['ordertype']]}></td>
		            </tr>
		            <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">配送时间：<{$items['posttime']|date_format:"%Y-%m-%d"}> <{$items['postdate']}></td>
		             	<td colspan="2" style="text-align:left;">订单类型：<{$shoptype[$items['shoptype']]}></td>   
		             	<td colspan="2" style="text-align:left;">ip信息：<{$items['ipaddress']}></td> 
		            </tr>
                <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">联系人：<{$items['buyername']}>[<{if empty($items['acountname'])}>游客<{else}>帐号:<{$items['acountname']}><{/if}>]</td>
		             	<td colspan="2" style="text-align:left;">消费地址：<{$items['buyeraddress']}></td>   
		             	<td colspan="2" style="text-align:left;">联系电话：<{$items['buyerphone']}></td> 
		            </tr>
	 <{/if}>
		            <tr> 
		            </tr>
		            <{if !empty($items['detlist'])}>
		            <tr style="height:20px;line-height:20px;">
		            	<td colspan="3" width="50%" valign=top>
		            		<table style="margin:0px;padding:0px;font-size:12px;" width="100%">
		            			<tr style="height:20px;line-height:20px;">
		            				<td style="border:none;padding:0px;color:gray;text-align:left;" width="60%">名称</td>
		            				<td style="border:none;padding:0px;color:gray;" width="15%">价格</td>
		            				<td style="border:none;padding:0px;color:gray;">数量</td> 
		            			</tr>
		            			<{foreach from=$items['detlist'] item=value}>  
		            			<tr style="height:20px;line-height:20px;"><td style="border:none;padding:0px;color:gray;text-align:left;"><{$value['goodsname']}><{if $value['is_send'] == 1}><font color=red>[赠品]</font><{/if}></td>
		            				  <td style="border:none;padding:0px;color:gray;"><{$value['goodscost']}>元</td>
		            				  <td style="border:none;padding:0px;color:gray;"><{$value['goodscount']}>份</td>
		            				  </tr> 
		            				<{/foreach}>  
		            				 
		            	    
		            		   
		            		 </table>
		            	</td>
		            	<td colspan="3" style="text-align:left;color:gray;" valign=top>
		            		 <table style="margin:0px;padding:0px;font-size:12px;text-align:left;" width="100%">
		            		    <{if $items['shopcost'] > 0}>
		            		   	<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">店铺商品总价</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red><{$items['shopcost']}></font>元</td>
		            		 		   </tr>
		            		 		<{/if}>
		            		 		 <{if $items['shopps'] > 0}>
		            		   	<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">店铺配送费</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red><{$items['shopps']}></font>元</td>
		            		 		   </tr>
		            		 		<{/if}>
		            		 	 
		            		 		<{if $items['scoredown'] > 0}>
		            		   	<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">积分低扣</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red>-<{$items['scoredown']/$scoretocost}></font>元,<{$items['scoredown']}>积分,比例：<{$scoretocost}>:1</td>
		            		 		   </tr>
		            		 		<{/if}>
		            		 		<{if $items['yhjcost'] > 0}>
		            		   	<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">优惠券低扣</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red>-<{$items['yhjcost']}></font>元</td>
		            		 		   </tr>
		            		 		<{/if}>
		            		 		<{if $items['cxcost'] > 0}>
		            		   	<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">店铺促销减金额</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red>-<{$items['cxcost']}></font>元</td>
		            		 		   </tr>
		            		 		<{/if}>
		            		 		<{if $items['bagcost'] > 0}>
		            		   	<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">打包费</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red><{$items['bagcost']}></font>元</td>
		            		 		   </tr>
		            		 		   
		            		 		<{/if}>
		            		 		<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">应收</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><font color=red><{$items['allcost']}></font>元 </td>
		            		 	   </tr>
		            		 	   <{if !empty($items['content'])}>
		            		 		<tr style="height:20px;line-height:20px;">
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">备注</td>
		            		 		  <td style="border:none;padding:0px;color:gray;"><{$items['content']}></td>
		            		 	   </tr> 
		            		 	   <{/if}>
		            		 	   <{if !empty($items['othertext'])}>
		            		 		<tr style="height:20px;line-height:20px;" valign=top>
		            		 		  <td style="border:none;padding:0px;color:gray;" width="100px;">其他说明</td> 
		            		 		  <td style="border:none;padding:0px;color:gray;">
		            		 		  	<{assign var=showother value=$items['othertext']|unserialize}>   
		            		 		  	 <{foreach from=$showother key=mytest item=itc}>
		            		 		  	  <{$mytest}>:<{$itc}>，
		            		 		  	 <{/foreach}>
		            		 		  	</td>
		            		 	   </tr> 
		            		 	   <{/if}>
		            		 </table> 
		            		 
		            		</td>
		            </tr>
		             <{/if}>
		            <tr >
		              <td colspan="6" style="text-align:left;" class="order_control"> 
		              	<{if $items['status'] == 0 }> 
		              	<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="#">关闭订单</a>    
		              	  <{if $items['paytype']=='0'}><a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/pass/datatype/json"}>">通过审核</a>     <{/if}>
		              	<{/if}>
			<{if $items['is_goshop'] != 1}>
		              	<{if $items['status'] == 1}>
		              	 	<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="javascript:void(0);">关闭订单</a>  
		              	    <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/send/datatype/json"}>">配送发货</a>     
		              	<{/if}>
		              	<{if $items['status'] == 2}>
		              	  	<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="javascript:void(0);">关闭订单</a>  
		              	    <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/over/datatype/json"}>">完成订单</a>     
		              	<{/if}>
						<{if $items['status'] == 3 }>
								<font color=#FBA101><{if $items['is_acceptorder']  == 1 }>用户已确认收货<{else}>用户未确认收货<{/if}></font>
						<{/if}>
			<{else}>
				<{if $items['is_make'] < 2 }>
			
					<{if $items['status'] == 1 || $items['status'] == 2}>
								<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="javascript:void(0);">关闭订单</a>  
								<a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/over/datatype/json"}>">完成订单</a> 
					<{/if}>
					<{if $items['status'] == 3 }>
								<font color=#FBA101><{if $items['is_acceptorder']  == 1 }>用户已确认收货<{else}>用户未确认收货<{/if}></font>
					 <{/if}>
					
					
				<{else}>
					<a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/del/datatype/json"}>">删除</a>  

				<{/if}>
			
			
			<{/if}>
		              	<{if $items['status'] == 4 || $items['status'] == 5 }>
		              	 <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/del/datatype/json"}>">删除</a>  
		              	<{/if}>
		              	<a href="javascript:void(0);"  onclick="printorder(<{$items['id']}>,0);">A4打印订单</a>	
							<a href="javascript:void(0);"  onclick="printorder(<{$items['id']}>,1);">小票打印订单</a>	
		              	<{if $items['wxstatus'] ==  1}>
		              	商家已确认订单
		              	<{elseif $items['wxstatus'] == 2}>
		              	商家需要取消此订单
		              	<{/if}>
		              	<{if $items['shoptype'] == 100}>
								<{if !empty($items['psusername'])}><{$items['psusername']}><{else}><a onclick="psorder(<{$items['id']}>,<{$items['dno']}>)" href="javascript:void(0);">选择配送员</a>   <{/if}>
		              	<{/if}>
		              	   下单IP：<{$items['ipaddress']}>  <{if $items['is_print']==1}>店铺已打印<{/if}>  <{if empty($items['is_make'])}>商家未确认是否制作<{elseif $items['is_make'] == 1}>商家确认制作<{else}>商家不制作，请取消此订单<{/if}>
		              

					  
	<{if $items['is_reback']  == 2 }><font color=blue>已退款成功 <input type="button" onclick="showqzdrawbutton(<{$items['id']}>);" value="查看退款记录" class="button"></font><{/if}>						  
	<{if $items['is_reback']  == 3 }><font color=blue>拒绝退款 <input type="button" onclick="showqzdrawbutton(<{$items['id']}>);" value="查看退款记录" class="button"> </font><{/if}>						  
	<{if $items['is_reback']  != 2 }><input type="button" onclick="qzdrawbutton(<{$items['id']}>);" value="退款" class="button"><{/if}>	



					  </td>
		            </tr>     
		            </table> 
					
					<{else}>
						
	 <table class="table table-bordered" width=95% style="font-size:12px;margin-top:5px;text-align:left;margin-left:20px;" id="order_area_<{$items['id']}>" onMouseover="colorred(this);" onMouseout="tcolorred(this);">					
					
		  <tr>
		             	<td colspan="2" style="text-align:left;">单号：<{$items['dno']}><font color=red>跑腿<{if $items['pttype']  == 1 }>【帮我送】<{/if}><{if $items['pttype']  == 2 }>【帮我买】<{/if}></font></td>
		             	<td colspan="2" style="text-align:left;">创建时间：<{$items['addtime']|date_format:"%Y-%m-%d %H:%M:%S"}></td>
		             	<td colspan="2" style="text-align:left;">订单状态: <font color=blue> <font color=blue><{$buyerstatus[$items['status']]}></font>
                    
						</font></td>
		            </tr>
				 
		             <tr style="height:20px;line-height:20px;">
					 <td colspan="2" style="text-align:left;"><{if $items['pttype']  == 1 }>取货时间<{/if}><{if $items['pttype']  == 2 }>收货时间<{/if}>：<{$items['posttime']|date_format:"%Y-%m-%d"}> <{$items['postdate']}></td>
		             	<td colspan="2" style="text-align:left;">支付方式：<font color=red><{$paytypearr[$items['paytype']]|default:'未定义'}><{if !empty($items['paytype_name'])}>(<{$payway[$items['paytype_name']]}>)<{/if}></font></td>
		             	<td colspan="2" style="text-align:left;">支付状态：<{if $items['paystatus'] == 1}>已付<{else}>未付<{/if}><font color=red><{$backarray[$items['is_reback']]}></font></td>
		            </tr>
		              <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">取货地址：<{$items['shopaddress']}></td>
		             	<td colspan="2" style="text-align:left;">收货地址：<{$items['buyeraddress']}></td>
		             	
		            </tr>
				<tr style="height:20px;line-height:20px;">
		             <{if $items['pttype'] == 1 }>	<td colspan="2" style="text-align:left;">取货电话: <{$items['shopphone']}></td> <{/if}>
		             	<td colspan="2" style="text-align:left;">收货电话: <{$items['buyerphone']}></td> 
		             	<td colspan="2" style="text-align:left;">联系人: <{$items['buyername']}></td> 
		            </tr>
					 
					  <tr style="height:20px;line-height:20px;">
		             	<td colspan="2" style="text-align:left;">总重量：<{$items['ptkg']}>公斤</td>
		             	<td colspan="2" style="text-align:left;">距离: <{$items['ptkm']}>千米</td> 
		            </tr>
					 	 
				<tr style="height:20px;line-height:20px;">
						<td colspan="2" style="text-align:left;">公斤金额：<{$items['allkgcost']}>元</td>
						<td colspan="2" style="text-align:left;">千米金额: <{$items['allkmcost']}>元</td>
						<{if $items['farecost'] != 0}><td colspan="2" style="text-align:left;color:red;">小费: <{$items['farecost']}>元</td><{/if}>
 		             	<td colspan="2" style="text-align:left;">里程总金额：<{$items['allcost']}>元</td>
 		            </tr>
					 
		            <tr style="height:20px;line-height:20px;">
		             	   	<td colspan="2" style="text-align:left;">下单来源: <{$ordertypearr[$items['ordertype']]}></td>
		             	<td colspan="2" style="text-align:left;">订单类型：跑腿<{if $items['pttype']  == 1 }>【帮我送】<{/if}><{if $items['pttype']  == 2 }>【帮我买】<{/if}></td>   
		             	<td colspan="2" style="text-align:left;">ip信息：<{$items['ipaddress']}></td> 
		            </tr>
                <tr style="height:20px;line-height:20px;">
		              
		             	<td colspan="6" style="text-align:left;">跑腿需求：<{$items['content']}></td> 
		            </tr>
	 
		     <tr >
		              <td colspan="6" style="text-align:left;" class="order_control"> 
		            
					
						<{if $items['status'] == 0 }> 
		              	<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="#">关闭订单</a>    
		              	  <{if $items['paytype']=='0'}><a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/pass/datatype/json"}>">通过审核</a>     <{/if}>
		              	<{/if}>
		              	<{if $items['status'] == 1}>
		              	 	<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="javascript:void(0);">关闭订单</a>  
		              	    <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/send/datatype/json"}>">配送发货</a>     
		              	<{/if}>
		              	<{if $items['status'] == 2}>
		              	  	<a onclick="unorder(<{$items['id']}>,<{$items['dno']}>);" href="javascript:void(0);">关闭订单</a>  
		              	    <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/over/datatype/json"}>">完成订单</a>     
		              	<{/if}>
						<{if $items['status'] == 3 }>
								<font color=#FBA101><{if $items['is_acceptorder']  == 1 }>用户已确认收货<{else}>用户未确认收货<{/if}></font>
						<{/if}>
		              	<{if $items['status'] == 4 || $items['status'] == 5 }>
		              	 <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/order/module/ordercontrol/id/<{$items['id']}>/type/del/datatype/json"}>">删除</a>  
		              	<{/if}>
					
						
							     	<a href="javascript:void(0);"  onclick="paotuiprintorder(<{$items['id']}>,0);">A4打印订单</a>	
							<a href="javascript:void(0);"  onclick="paotuiprintorder(<{$items['id']}>,1);">小票打印订单</a>


	<{if $items['shoptype'] == 100}>
								<{if !empty($items['psusername'])}><{$items['psusername']}><{else}><a onclick="psorder(<{$items['id']}>,<{$items['dno']}>)" href="javascript:void(0);">选择配送员</a>   <{/if}>
		              	<{/if}>
		              	   下单IP：<{$items['ipaddress']}>  						

					</td>
		            </tr> 
	 
	 
	 </table>
		<{/if}>
		          <{/foreach}>
		          
		          
		          

                <div class="blank20"></div> 

                </form>

                <div class="page_newc">
                 	    
                       <div class="show_page"><ul><{$pagecontent}></ul></div>
                 </div>
                <div class="blank20"></div>

              </div>

            </div>

          </div>

        </div>

        
  </div>
  <div id="print_area" style="display:none;font-size:40px;"></div>
 </div>
<script type="text/javascript">
   function colorred(obj){
   	$(obj).css('background','#eee'); 
   }
   function tcolorred(obj){
   	$(obj).css('background','');
   }
    function closeddraw(){
   
	   window.location.reload();
   
   }
   function unorder(orderid,dno)
	 { 
	 	   var dialog =  art.dialog({
	 	   	id:'coslid',
        title:'取消订单'+dno,
           content: '<div>关闭订单理由</div> <div><textarea name="reason" id="reason" style="height:40px;"></textarea></div><div class="btn_wuxiao hc_listfoods_menus_foods hcl_food_lists_cont_div_order2 hcl_food_lists_cont_div_order4 hc_listfoods_menus_foods2" style="width:65px;float:left;" onclick="sureclose('+orderid+');">提交关闭</div>'
        });
	 }
	 
	 function sureclose(orderid)
	 {
	 	  var reasons = $('#reason').val();
	 	  if(reasons == undefined || reasons == '')
	 	  {
	 	  	alert('关闭理由不能为空');
	 	  }else{ //{'orderid':orderid,'reason':reasons}
	 	    var url = siteurl+'/index.php?ctrl=adminpage&action=order&module=ordercontrol&type=un&id='+orderid+'&reasons='+reasons+'&datatype=json&random=@random@';
	 	    $.ajax({
     type: 'get',
     async:false, 
     url: url.replace('@random@', 1+Math.round(Math.random()*1000)), 
     dataType: 'json',success: function(content) {  
     	if(content.error == false){
     		diasucces('操作成功','');
     	}else{
     		if(content.error == true)
     		{
     			diaerror(content.msg); 
     		}else{
     			diaerror(content); 
     		}
     	} 
		},
    error: function(content) { 
    	diaerror('数据获取失败'); 
	  }
   });   
	 	 }
	 }
	 function selectdo(msg){
		diasucces(msg,'');
}
function openlink(newlinkes){
					window.location.href=newlinkes;
}
function dofirch(obj){
	gorefresh(); 
}
  function printorder(orderid,printtype)   //正常订单
	{
	    if(printtype == 1){//小票打印
			mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=order&module=orderprint&orderid='+orderid+'&printtype='+printtype,{height:'600px',width:'400px'},false); 
		 }else{
		   mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=order&module=orderprint&orderid='+orderid+'&printtype='+printtype,{height:'690px',width:'794px'},false);  
		 }
	   /*
		$('#print_area').html('');
	 $('#order_area_'+orderid).clone().appendTo($('#print_area'));
	 $("#print_area").find('.order_control').remove();
	  $("#print_area").printArea();  */ 
  }
  
 function paotuiprintorder(orderid,printtype)		// 跑腿
	{
	    if(printtype == 1){//小票打印
			mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=order&module=paotuiorderprint&orderid='+orderid+'&printtype='+printtype,{height:'600px',width:'400px'},false); 
		 }else{
		   mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=order&module=paotuiorderprint&orderid='+orderid+'&printtype='+printtype,{height:'690px',width:'794px'},false);  
		 }
	   /*
		$('#print_area').html('');
	 $('#order_area_'+orderid).clone().appendTo($('#print_area'));
	 $("#print_area").find('.order_control').remove();
	  $("#print_area").printArea();  */ 
  }  
  

 function qzdrawbutton(orderid)		//退款操作
	{
	  
			mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=order&module=draworderinfo&orderid='+orderid,{height:'600px',width:'400px'},false); 
		 
  }  
  

 function showqzdrawbutton(orderid)		// 查看退款记录
	{
	  
			mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=order&module=showdraworderlog&orderid='+orderid,{height:'400px',width:'600px'},false); 
		 
  }  
  
  function print_all_area()
  {
  	$('#print_area').html($('#all_area').html());
	  $("#print_area").find('.order_control').remove();
	  $("#print_area").printArea();
  }
  function doautodel(){
  	 if(confirm('确认手动操作?\n 操作后将删除待审核和已关闭订单,\n 也将根据设置的自动发货天数自动发货和完成')){
  	 	var dourl = '<{ofunc type=url link="/adminpage/order/module/autodel"}>';
  	 	window.location.href= dourl;
  	 	
  	} 
  }
   var mydialog;
	 function psorder(orderid,dno){
	   //审核订单
	   mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=psuser&module=selectps&orderid='+orderid,{height:'550px',width:'850px'},false); 
	 	 mydialog.title('设置配送员'); 
	 	  
	 }
 </script>
<{/block}>